package com.example.demoweb.controller;

import com.sun.org.apache.regexp.internal.RE;
import org.springframework.web.bind.annotation.*;

/**
 * @Author: chengyunlai
 * @Date: 2021/7/26 16:24
 * @Description: com.example.demoweb.controller
 * @Version: 1.0.0
 */
@RestController
public class HelloController {

    @RequestMapping("/img/house.png")
    public String hello() {
        String hello = "hello";
        return hello;
    }

//    @RequestMapping(value = "/user", method = RequestMethod.GET)
    @GetMapping(value = "/user")
    public String getUser() {
        return "GET-张三";
    }

//    @RequestMapping(value = "/user", method = RequestMethod.POST)
    @PostMapping(value = "/user")
    public String saveUser() {
        return "POST-张三";
    }

//    @RequestMapping(value = "/user", method = RequestMethod.PUT)
    @PutMapping(value = "/user")
    public String putUser() {
        return "PUT-张三";
    }

//    @RequestMapping(value = "/user", method = RequestMethod.DELETE)
    @DeleteMapping(value = "/user")
    public String deleteUser() {
        return "DELETE-张三";
    }
}
